/*    */
package com.liang.nansheng.common.web.basic;
/*    */
/*    */

import com.liang.nansheng.common.enums.ResponseCode;

/*    */
/*    */ public class ResponseResult<T>
        /*    */ {
    /*    */   private Integer code;
    /*    */   private String desc;
    /*    */   private T data;

    /*    */
    public ResponseResult() {
        /*    */
    }

    /* 22 */
    public ResponseResult(Integer code, String desc, T data) {
        this.code = code;
        this.desc = desc;
        this.data = data;
        /*    */
    }

    /*    */
    /*    */
    public static <T> ResponseResult<T> success(T data)
    /*    */ {
        /* 30 */
        return (ResponseResult<T>) builder().code(ResponseCode.SUCCESS.getCode()).desc(ResponseCode.SUCCESS.getDesc()).data(data).build();

    }

    /*    */
    /*    */
    public static <T> ResponseResult<T> build(ResponseCode responseCode, T data) {
        /* 38 */
        return (ResponseResult<T>) builder()
/* 39 */.code(responseCode
/* 39 */.getCode())
/* 40 */.desc(responseCode
/* 40 */.getDesc())
/* 41 */.data(data)
/* 42 */.build();
        /*    */
    }

    /*    */
    /*    */
    public static <T> ResponseResultBuilder<T> builder()
    /*    */ {
        /* 20 */
        return new ResponseResultBuilder();
        /*    */
    }

    /*    */
    /*    */
    public Integer getCode()
    /*    */ {
        /* 25 */
        return this.code;
    }

    /*    */
    /*    */
    /*    */
    public void setCode(Integer code)
    /*    */ {
        /* 19 */
        this.code = code;
    }

    /* 26 */
    public String getDesc() {
        return this.desc;
    }

    /* 19 */
    public void setDesc(String desc) {
        this.desc = desc;
    }

    /* 27 */
    public T getData() {
        return this.data;
    }

    /* 19 */
    public void setData(T data) {
        this.data = data;
    }

    /* 19 */
    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof ResponseResult)) return false;
        ResponseResult other = (ResponseResult) o;
        if (!other.canEqual(this)) return false;
        Object this$code = getCode();
        Object other$code = other.getCode();
        if (this$code == null ? other$code != null : !this$code.equals(other$code)) return false;
        Object this$desc = getDesc();
        Object other$desc = other.getDesc();
        if (this$desc == null ? other$desc != null : !this$desc.equals(other$desc)) return false;
        Object this$data = getData();
        Object other$data = other.getData();
        return this$data == null ? other$data == null : this$data.equals(other$data);
    }

    /* 19 */
    protected boolean canEqual(Object other) {
        return other instanceof ResponseResult;
    }

    /* 19 */
    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Object $code = getCode();
        result = result * 59 + ($code == null ? 43 : $code.hashCode());
        Object $desc = getDesc();
        result = result * 59 + ($desc == null ? 43 : $desc.hashCode());
        Object $data = getData();
        result = result * 59 + ($data == null ? 43 : $data.hashCode());
        return result;
    }

    /* 19 */
    public String toString() {
        return "ResponseResult(code=" + getCode() + ", desc=" + getDesc() + ", data=" + getData() + ")";
    }

    /*    */
    /*    */   public static class ResponseResultBuilder<T>
            /*    */ {
        /*    */     private Integer code;
        /*    */     private String desc;
        /*    */     private T data;

        /*    */
        /*    */
        public ResponseResultBuilder<T> code(Integer code)
        /*    */ {
            /* 20 */
            this.code = code;
            return this;
        }

        /* 20 */
        public ResponseResultBuilder<T> desc(String desc) {
            this.desc = desc;
            return this;
        }

        /* 20 */
        public ResponseResultBuilder<T> data(T data) {
            this.data = data;
            return this;
        }

        /* 20 */
        public ResponseResult<T> build() {
            return new ResponseResult(this.code, this.desc, this.data);
        }

        /* 20 */
        public String toString() {
            return "ResponseResult.ResponseResultBuilder(code=" + this.code + ", desc=" + this.desc + ", data=" + this.data + ")";
        }
        /*    */
        /*    */
    }
    /*    */
}

/* Location:           C:\maven\maven3.5\maven3.5\repositor\io\github\maliangnansheng\nansheng-common\3.3.4\nansheng-common-3.3.4.jar
 * Qualified Name:     com.liang.nansheng.common.web.basic.ResponseResult
 * JD-Core Version:    0.6.2
 */